package aad.storyboard.controller;

import java.util.ArrayList;
import java.util.HashMap;

import utils.ViewUtils;

import aad.storyboard.model.BlackFader;
import aad.storyboard.model.BlueFader;
import aad.storyboard.model.Fader;
import aad.storyboard.model.GreenFader;
import aad.storyboard.model.RedFader;
import aad.storyboard.model.YellowFader;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Bitmap.Config;


public class TransitionProvider {
	
	
	private ArrayList <SceneTransition> transitions;
	 private HashMap<Integer, Fader> fadeStrategies=new HashMap<Integer, Fader>();
	 private Bitmap fadeBitmap;
	
	private static TransitionProvider inst = new TransitionProvider ();

	private TransitionProvider(){
		transitions=new ArrayList <SceneTransition>();
		
		fadeBitmap = Bitmap.createBitmap( ViewUtils.screenWidth,ViewUtils.screenHeight, Config.ARGB_8888); 
		
		 RedFader redfader=new RedFader(fadeBitmap); 
	     BlackFader blackfader=new BlackFader(fadeBitmap);
	     GreenFader gfader=new GreenFader(fadeBitmap);
	     YellowFader yfader=new YellowFader (fadeBitmap);     
	     BlueFader blfader=new BlueFader (fadeBitmap);
	     
	     fadeStrategies.put(Color.RED, redfader);
	     fadeStrategies.put(Color.BLACK, blackfader);
	     fadeStrategies.put(Color.BLUE, blfader);
	     fadeStrategies.put(Color.YELLOW, yfader);
	     fadeStrategies.put(Color.GREEN, gfader);
	}
	
	public static TransitionProvider getInstance(){
		return inst;
	}
	
	public ArrayList <SceneTransition> getTransitions()
	{
		return transitions;
	}
	
	public void addTransition(SceneTransition st )
	{
		transitions.add(st);
	}

	public HashMap<Integer, Fader> getFadeStratiegies() {
		
		return fadeStrategies;
	}

	public Bitmap getFadeBitmap() {
		
		return fadeBitmap;
	}

	

}
